package com.heima.behavior.controller.v1;

import com.heima.behavior.service.IApUnlikeBehaviorService;
import com.heima.model.behavior.dtos.UnlikeBehaviorDTO;
import com.heima.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "不喜欢行为 API")
@RestController
@RequestMapping("api/v1/un_likes_behavior")
public class ApUnlikesBehaviorController {

    @Autowired
    private IApUnlikeBehaviorService apUnlikeBehaviorService;

    @ApiOperation(value = "记录用户的喜好", notes = "用户对文章的喜欢或不喜欢")
    @PostMapping
    public ResponseResult handleUnlike(@RequestBody UnlikeBehaviorDTO unlikeBehaviorDTO){
        return apUnlikeBehaviorService.handleUnlike(unlikeBehaviorDTO);
    }

}
